﻿using HamcoWcs.Entitys.Bases;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Text;

namespace HamcoWcs.Entitys
{
    /// <summary>
    /// 保养信息（记录）
    /// </summary>
    public class MaintainRecord : BaseEntity, IEntityTypeConfiguration<MaintainRecord>
    {

        /// <summary>
        /// 保养内容
        /// </summary>
        public string Content { get; set; }
        /// <summary>
        /// 机台名
        /// </summary>
        public string? MachineName { get; set; }
        /// <summary>
        /// 保养人
        /// </summary>
        public string UnderTaker { get; set; }
        /// <summary>
        /// 维护时间
        /// </summary>
        public DateTime MaintainTime { get; set; }


        public void Configure(EntityTypeBuilder<MaintainRecord> builder)
        {
            builder.HasComment("维护保养记录");
            builder.Property(x => x.MaintainTime).HasComment("维护时间");
            builder.Property(x => x.Content).HasMaxLength(1024).HasComment("内容");
            builder.Property(x => x.UnderTaker).HasMaxLength(20).HasComment("保养人");
            builder.Property(x => x.MachineName).IsRequired(false).HasMaxLength(50).HasComment("保养人");

        }
    }
}
